package com.alpha.framework.activity;

import com.alpha.framework.manager.ActivityManager;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Window;

public abstract class BaseActivity extends FragmentActivity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ActivityManager.getManager().pushActivity(this);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		init();
		initView();
		loadData();
	}
	
	/** 加载数据 或网络请求数据 */
	protected void loadData(){
		
	}
	
	@Override
	protected void onResume() {
		super.onResume();
	}
	
	@Override
	protected void onPause() {
		super.onPause();
	}

	/** 数据初始化 */
	protected void init() {
	}

	/** 界面初始化 */
	protected abstract void initView();

	@Override
	protected void onDestroy() {
		super.onDestroy();
		//销毁时从自定义的栈中删除
		ActivityManager.getManager().popActivity(this);
	}
}
